//package com.yunxin.admin.system.api.core.product;
//
//
//import com.yunxin.admin.system.infra.common.constant.SecurityConstants;
//import com.yunxin.admin.system.infra.framework.security.util.SecurityUtils;
//import com.yunxin.common.result.Result;
//import com.yunxin.core.domain.service.product.ProductQualityConfigService;
//import com.yunxin.core.infra.common.product.util.ProductQualityUtil;
//import com.yunxin.core.infra.persistence.entity.product.ProductQualityConfig;
//import io.swagger.v3.oas.annotations.Operation;
//import io.swagger.v3.oas.annotations.security.SecurityRequirement;
//import io.swagger.v3.oas.annotations.tags.Tag;
//import jakarta.validation.Valid;
//import lombok.RequiredArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.*;
//
//
///**
// * @author zero°
// * @since 2023-05-29
// */
//@Tag(name = "52.产品质量配置管理")
//@Slf4j
//@RestController
//@RequestMapping("/core/v1/productQuality")
//@RequiredArgsConstructor
//public class ProductQualityController {
//
//    private final ProductQualityConfigService productQualityConfigService;
//
//
//
//    @Operation(summary = "查看产品对应质量配置", security = {@SecurityRequirement(name = SecurityConstants.TOKEN_KEY)})
//    @PostMapping("/detailByProductId")
//    public Result<ProductQualityConfig> detailByProductId(@RequestParam Long productId)   {
//
//        ProductQualityConfig one = productQualityConfigService.lambdaQuery()
//                .eq(ProductQualityConfig::getProductId, productId)
//                .one();
//
//        return Result.success(one);
//    }
//
//    @Operation(summary = "修改", security = {@SecurityRequirement(name = SecurityConstants.TOKEN_KEY)})
//    @PostMapping("/updateById")
//    public Result<Boolean> detailByProductId(@RequestBody @Valid ProductQualityConfig config) {
//
//
//        if (!ProductQualityUtil.checkFull(config)) {
//            return Result.failed("开启后,默认值为空");
//        }
//
//        config.setEditTime(new Date());
//        config.setEditor(SecurityUtils.X.getUserId().toString());
//        boolean b = productQualityConfigService.updateById(config);
//        return Result.success(b);
//    }
//
//
//}
